Learn R Programming

ks (version 1.5.10)

Hpi, Hpi.diag, hpi: Plug-in bandwidth matrix selector for multivariate data

Description

Plug-in bandwidth matrix for for 1- to 6-dimensional data.

Usage

Hpi(x, nstage=2, pilot="samse", pre="sphere", Hstart,
    binned=FALSE, bgridsize, amise=FALSE)
Hpi.diag(x, nstage=2, pilot="amse", pre="scale", Hstart,
    binned=FALSE, bgridsize)
hpi(x, nstage=2, binned=TRUE, bgridsize)

Arguments

Value

  • Plug-in bandwidth matrix. If amise=TRUE then the plug-in bandwidth plus the estimated AMISE is returned in a list.

Details

Use Hpi for full bandwidth matrices and Hpi.diag for diagonal bandwidth matrices.

For AMSE pilot bandwidths, see Wand & Jones (1994). For SAMSE pilot bandwidths, see Duong & Hazelton (2003). The latter is a modification of the former, in order to remove any possible problems with non-positive definiteness. Unconstrained pilot bandwidths are available for d = 1, ..., 5 (but are extremely computationally intensive for the latter dimensions). See Chac'on & Duong (2008).

For d = 2, 3, 4 and binned=TRUE, the density estimate is computed over a binning grid defined by bgridsize. Otherwise it's computed exactly.

For d = 1, the selector hpi is exactly the same as KernSmooth's dpik. This is always computed as binned estimator. For details on the pre-transformations in pre, see pre.sphere and pre.scale.

If Hstart is not given then it defaults to k*var(x) where k = $\left[\frac{4}{n(d+2)}\right]^{2/(d+4)}$, n = sample size, d = dimension of data.

References

Chac'on, J.E. & Duong, T. (2008) Multivariate plug-in bandwidth selection with unconstrained pilot matrices. Submitted. Duong, T. & Hazelton, M.L. (2003) Plug-in bandwidth matrices for bivariate kernel density estimation. Journal of Nonparametric Statistics, 15, 17-30. Wand, M.P. & Jones, M.C. (1994) Multivariate plugin bandwidth selection. Computational Statistics, 9, 97-116.

Examples

Run this code
## univariate example
x <- rnorm.mixt(100, mus=0, sigmas=1)
hpi(x)

## bivariate example
data(unicef)
Hpi(unicef)
Hpi(unicef, binned=TRUE)
Hpi.diag(unicef)
Hpi(unicef, pilot="unconstr")

## 4-variate example
x <- rmvnorm.mixt(n=100, mus=rep(0,4), diag(4))
Hpi(x)
Hpi.diag(x, pilot="samse")

Run the code above in your browser using DataLab